package b4.view.component.pack
{
	import b4.util.BFont;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;

	public class ObjMessageTip extends Sprite
	{
		private var fixedWidth:Number;
		
		public function ObjMessageTip(width:Number)
		{
			super();
			this.fixedWidth = width;
		}
		
		public function appendText(htmlStr:String):void
		{
			var tipText:TextField = new TextField();
			tipText.selectable = false;
        	tipText.autoSize = TextFieldAutoSize.LEFT;
        	tipText.wordWrap = true;
        	tipText.multiline = true;
        	tipText.width = fixedWidth;
        	var texFormat:TextFormat = new TextFormat(BFont.DEFAULT_FONT, 14, 0xFFFFFF);
			tipText.defaultTextFormat = texFormat;
			tipText.htmlText = htmlStr;
			tipText.y = height > 0 ? height - 8: 0;
			addChild(tipText);
		}
		
	}
}